package com.ice.day726.thread;

/**
 * @Author ice2020x
 * @Date 2022-07-26 13:24
 * @Description: 测试栈帧 每个线程有独立的栈内存，执行的栈帧互不相干
 */
public class TestFrames {

    public static void main(String[] args) {

        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                method1(20);
            }
        });
        t1.setName("t1");
        t1.start();
        method1(10);
    }


    public static void  method1(int x) {
        int y = x+1;
        Object n = method2();
        System.out.println(n);
    }

    public static Object method2() {
        return new Object();
    }



}
